home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
pctchnqs
/
1990
/
number3
/
lists.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-05-21
|
583b
|
42 lines
{ Listing 2 - The Lists unit }
UNIT Lists;
INTERFACE
TYPE
ListNodePtr = ^ListNode;
ListNode = OBJECT
Next : ListNodePtr;
PROCEDURE Init;
PROCEDURE App(NewList : ListNodePtr);
END;
IMPLEMENTATION
PROCEDURE ListNode.Init;
BEGIN
Next := NIL;
END;
PROCEDURE ListNode.App(NewList : ListNodePtr);
VAR
TmpPtr : ListNodePtr;
BEGIN
IF Next = NIL THEN
Next := NewList
ELSE BEGIN
TmpPtr := Next;
WHILE TmpPtr^.Next <> NIL DO
TmpPtr := TmpPtr^.Next;
TmpPtr^.Next := NewList;
END;
END;
END.